package zuoye_3_24;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Random;

public class Zuoye_2 {
	public static void main(String[] args) throws IOException {
		ArrayList list = new ArrayList<Student>();
		BufferedReader r = new BufferedReader(new FileReader("names1.txt"));
		String line;
		while((line=r.readLine())!=null) {
			String arr[] = line.split("-");
			Student stu = new Student(arr[0], arr[1], Integer.parseInt(arr[2]),Double.parseDouble(arr[3]));
			list.add(stu);
		}
		Random ra = new Random();
		String name = ((Student) list.get(ra.nextInt(list.size()))).getName();
		Student st = (Student) list.get(ra.nextInt(list.size()));
		System.out.println(name);
	}
}
